3.76 \(\int \frac{1+2 x+x^2}{(1+x^2)^2} \, dx\)

Optimal. Leaf size=12 \[ \tan ^{-1}(x)-\frac{1}{x^2+1} \]

[Out]

-(1 + x^2)^(-1) + ArcTan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0071213, antiderivative size = 22, normalized size of antiderivative = 1.83, number of steps used = 3, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {27, 723, 203} \[ \tan ^{-1}(x)-\frac{(1-x) (x+1)}{2 \left (x^2+1\right )} \]

Antiderivative was successfully verified.

[In]

Int[(1 + 2*x + x^2)/(1 + x^2)^2,x]

[Out]

-((1 - x)*(1 + x))/(2*(1 + x^2)) + ArcTan[x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 723

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(a*e - c*d*x)*(a
 + c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] + Dist[((2*p + 3)*(c*d^2 + a*e^2))/(2*a*c*(p + 1)), Int[(d + e*x)^(m -
2)*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 2, 0] && Lt
Q[p, -1]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{1+2 x+x^2}{\left (1+x^2\right )^2} \, dx &=\int \frac{(1+x)^2}{\left (1+x^2\right )^2} \, dx\\ &=-\frac{(1-x) (1+x)}{2 \left (1+x^2\right )}+\int \frac{1}{1+x^2} \, dx\\ &=-\frac{(1-x) (1+x)}{2 \left (1+x^2\right )}+\tan ^{-1}(x)\\ \end{align*}

Mathematica [A]  time = 0.0122203, size = 12, normalized size = 1. \[ \tan ^{-1}(x)-\frac{1}{x^2+1} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + 2*x + x^2)/(1 + x^2)^2,x]

[Out]

-(1 + x^2)^(-1) + ArcTan[x]

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 13, normalized size = 1.1 \begin{align*} - \left ({x}^{2}+1 \right ) ^{-1}+\arctan \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+2*x+1)/(x^2+1)^2,x)

[Out]

-1/(x^2+1)+arctan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.46191, size = 16, normalized size = 1.33 \begin{align*} -\frac{1}{x^{2} + 1} + \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="maxima")

[Out]

-1/(x^2 + 1) + arctan(x)

________________________________________________________________________________________

Fricas [A]  time = 0.957922, size = 50, normalized size = 4.17 \begin{align*} \frac{{\left (x^{2} + 1\right )} \arctan \left (x\right ) - 1}{x^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="fricas")

[Out]

((x^2 + 1)*arctan(x) - 1)/(x^2 + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.102492, size = 8, normalized size = 0.67 \begin{align*} \operatorname{atan}{\left (x \right )} - \frac{1}{x^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+2*x+1)/(x**2+1)**2,x)

[Out]

atan(x) - 1/(x**2 + 1)

________________________________________________________________________________________

Giac [A]  time = 1.17692, size = 16, normalized size = 1.33 \begin{align*} -\frac{1}{x^{2} + 1} + \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+2*x+1)/(x^2+1)^2,x, algorithm="giac")

[Out]

-1/(x^2 + 1) + arctan(x)